﻿package org.openChart.sprite 
{
	import flash.display.Sprite;
	import org.openChart.display.DisplayStick;
	import org.openChart.display.DisplayTextLabel;
	import org.openChart.display.DisplayXAxis;
	import org.openChart.meta.TextLabel;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author Chongyuan
	 */
	public class XAxisSprite extends ContainerSprite
	{
		public function XAxisSprite( axis:DisplayXAxis, commandHandler:CommandHandler) 
		{
			super(axis, commandHandler);
			
			var i:uint = 0;
			for ( i = 0 ; i < axis.sticks.length; i++ )
			{
				var displayStick:DisplayStick = axis.sticks.getAt(i);
				var stickSprite:StickSprite = new StickSprite(displayStick, null);
				this.addChild(stickSprite);
			}
			
			for ( i = 0; i < axis.labels.length; i++ )
			{
				var displayLabel:DisplayTextLabel = axis.labels.getAt(i);
				var labelSprite:TextLabelSprite = new TextLabelSprite(displayLabel, null);
				this.addChild(labelSprite);
			}
			
			var title:TextLabelSprite = new TextLabelSprite(axis.title, null);
			this.addChild(title);
			var line:AxisLineSprite = new AxisLineSprite(axis, this);
			this.addChild(line);
		}
		
		public override function paint():void
		{
			
		}
		
		
	}
	
}